NOTE: Sample code is maintained and blessed by Bob Ebert. Please mail ebert@newton.apple.com orALink: EBERT if you would like to comment, request, submit, or otherwise chat about sample code.
DTS does not necessarily guarantee lack of bugs and/or suitability of samples for home use. The sample code provided by DTS should run and have some reasonable level of documentation, and will generally illustrate an important point about Newton programming, but should not be viewed as the correct or ideal approach for all occasions. Design issues vary from application to application, and (good as they are) the DTS engineers occasionally make mistakes.
Sample code is on ftp.apple.com in pie/newton/samples.
Sample code is on the Apple engineering net in EtherKnott:ES•Newton Software
Sample code is on AppleLink, spread around the appropriate sub-folders, in:
description: This application is the basic template for creation of data logging applications. It will store and retrieve records from a soup, also beam, find, use Newton Connection kit and file the entries.
True Grid v1-7/11/94 by Bob Ebert for Newton ToolKit
category: Application Design
keywords: Grid View, Drawing, columns, proto, performance
description: Implements three different ways to do scrolling "grid" views based on soup data, and evaluates the complexity and performance tradeoffs of each.
ADSP Sample v2-7/11/94 by Mike Cremer, Randy Carr, Kent Sandvik, Jim Schram for Newton ToolKit
description: This sample app is based on the terminal emulator first introduced in andCrank and BitSpew. It has been modified to support the modem tool, including Apple and some Rockwell modems. It sets up a modem endpoint using the sampleModemEndpoint, mySerialIOPrefs, and myServicePrefs, then Instantiates in the connectButton's viewClickScript and Connects as a deferred action in ConnectMe.
IR Remote Sample v2-7/11/94 by Mike Cremer & Kent Sandvik for Newton ToolKit
category: Communications
keywords: Communications endpoint IR remote control
description: This sample shows how to make use of the specific IR functions for controlling consumer electronics applications. See the Q&A Communication sample for technical details. Note that the RC5.r file has resources for controlling Philips devices, and the Sony.r file has resource definitions for Sony consumer electronics products. You need to contact various other consumer electronics companies for more infomation about their IR protocols.
IRSample v1-12/22/93 by Mike Cremer & Randy Carr & Kent Sandvik for Newton ToolKit
category: Communications
keywords: Communication, IR, InfraRed, endpoint
description: This sample shows how to make use of the IR endpoints, also how to write IR protocol applications.
IRTimeSync v2-7/11/94 by Jim Schram for Newton ToolKit
category: Communications
keywords: IR Beam Time Synchronization State Machine Timeout
description: Synchronize the date-time clocks of two Newtons via IR beaming. Demonstrates:
1. Clock synchronization to +/- one second.
2. Using SharpIR beaming protocol with strings.
3. Simple state machine.
4. Asynchronous Connect().
5. Handling time-outs.
6. Synchronous SysBeep().
LlamaTalk v1-7/11/94 by Jim Schram for Newton ToolKit
category: Communications
keywords: LlamaTalk LlamaShare AppleTalk ADSP MNP Echo Server State Machine
description: Everything you ever wanted to know about making ADSP work in Newton OS 1.3 and earlier (don't taunt the ADSP endpoint...) This is a HUGE two-part sample comprised of both Newton & Mac code. The Newton component is a simple front-end which demonstrates sending and receiving transactions of various data types. It makes calls to a protoLlamaTalk user proto which is an encapsulation of EVERYTHING needed to handle ADSP and MNP communications reliably. The Mac component is a simple back-end which receives transactions and echos back a "hex dump" of the transaction data. It makes calls to a robust multiple-client communications library built on top of the Mac CommToolBox. ALL I/O is asynchronous and interrupt-driven. The library uses no globals and can be called from within an Application, Control Panel, Init, XCommand, 4D External, etc. etc
pseudoInspector v2-3/1/94 by Todd Courtois for Newton ToolKit
category: Communications
keywords: serial, comms, "inspector"
description: This sample takes the SerialProtocol sample of Kent Sandvik one step further by implementing a very primitive Inspector. Strings that are sent to the newton (using the same method as in SerialPro) are processed kinda like in the Inspector or Inspector Gadget.
Version 2 cleans out Print statements and resizes properly.
SuperSlurp v1-7/11/94 by Jim Schram, Todd Courtois, ZZ, Kent Sandvik for Newton ToolKit
category: Communications
keywords: soup, serial MNP endpoint, connection to PC or Mac
description: SuperSlurp sucks soup data down from a Mac via a serial endpoint, then stuffs it into a soup. SuperSlurp has the capability of creating soups which are currently non-resident on the Newton at runtime, by command of the Mac.
SuperSlurp uses SERIAL MNP at 57600 bps. Must have the Apple Modem CTB Tool which comes with NTK to use it. Stuffs entries into the soup much much faster than old Slurp, also transfers data much faster and more reliably with MNP.
Built-In MetaDatas v1-12/15/93 by Peter Alley for Text
category: Connection Kit
keywords: MetaData, Newton Connection, Built In Apps
description: These are the updated MetaDatas for the built in Names and Card File applications for Newton Connection 2.0. They illustrate the validation and multiple-export script features of Connection 2.0. (They won't be found in the Newton, since they're encapsulated inside Newton Connection.)
Sync Another One v2-3/8/94 by Bob Ebert for Newton ToolKit
category: Connection Kit
keywords: Newton Connection, Macintosh, PC, Windows, MetaData, Soup, Store, User Interface
description: Illustrates how to write (and TEST) Newton Connection MetaData.
Soup Hacking v1-9/15/93 by Kent Sandvik for Inspector/Listner
description: Inspector-compatible text file illustrating some useful Soup functions.
Soup Tour v2-3/7/93 by David Levy & Kent Sandvik for Inspector/Listner
category: Data Storage (Soups)
keywords: Soup index entries stores Query Cursor
description: This is a simple walkthrough of many store and soup functions, including queries and smart index tricks. Check this out using an Inspector Window.
Beyond Help v3-7/11/94 by Bob Ebert & Maurice Sharp for Newton Book Maker
category: Digital books
keywords: Help Book, Dickens, Tiny Tim, How Do I
description: Illustrates creation and usege of a custom help book.
BookSample v2-11/12/93 by Bob Ebert for Newton Book Maker
category: Digital books
keywords: Digital Books, Dickens, Copperfield, Book Maker, Book Reader, Users Guide
description: A sample book source--the Newton Book Maker User's Manual in Newton Book Reader form.
Different Strokes v2-9/15/93 by Bob Ebert for Newton ToolKit
category: Drawing
keywords: Drawing, viewClickScript, ink
description: demonstrates how to capture ink and turn it into drawing objects for rendering on the screen, saving, etc.
Dot2Dot v2-9/15/93 by Kent Sandvik for Newton ToolKit
category: Drawing
keywords: view points polygon
description: Demonstrates the following:
• mapping global coordinates to local ones
• tracking pen clicks and convert them to an array suitable for a polygon
• view system handling
• creating arrays in RAM
• dynamically changing a clPictureView's icon slot
Drawing v2-2/28/94 by Bob Ebert for Newton ToolKit
category: Drawing
keywords: drawing, polygon, line, point, rectangle, style, font, pict, shape
description: Demonstrates functions in drawing chapter, shows how to make shapes and display them, as well as how to offset the shapes.
Font Scaling v3-9/15/93 by Bob Ebert for Newton ToolKit
category: Drawing
keywords: drawing, font, scaling, pict, word, dictionary
description: Demonstrates how to scale fonts. Not as simple as you might think at first... you have to put a text shape into a PICT shape and scale that. There are some clipping concerns as well.
GetPoly v1-7/11/94 by J. Christopher Bell for Newton ToolKit
category: Drawing
keywords: clPolygonView
description: This example shows how you can acquire a "points" structure for use with a clPolygonView. The GetPoly sample uses two techniques, one using shape recognition and another using all points in a pen stroke.
description: Shows how one can do fast text drawing by hand. Simple blasts an array of text lines to a clView. Does no wrapping, but scrolls.
Calls to GetRandomWord() could be replaced by useful text-formatting routines to take your gobs of text and get it onscreen quickly. Important for things like terminal emulators.
IdleScript Anime v2-2/28/94 by Todd Courtois for Newton ToolKit
category: Drawing
keywords: IdleScript drawing, animation, PlaySound and drawing speed effects, protoIconButton
description: This app contains four similar clViews which execute simple animation in their idleScripts.
MonacoTest v2-3/11/94 by Kent Sandvik & Mike Engber for
category: Drawing
keywords: Fonts
description: This sample provides a mono-spaced font for use on the Newton (Monaco 9) and gives a short demonstration of how to use it.
Up In Smoke v3-10/1/93 by Mike Engber for Newton ToolKit
category: Drawing
keywords: Smoke, Clouds, Poof, Drawing, CopyBits
description: Shows how to achieve the ever popular smoke/poof/scrub effect. Also illustrates scaling with CopyBits, using modeMask with CopyBits, and using BuildContext to force an update of an area of the screen.
IA Tour v3-2/28/94 by Bill Luciw for Inspector/Listner
description: This is code used during the Newton Developer Conference-93, Intelligent Assist presentation. Version 2 fixes a couple of bugs that prevented straight through allocation. It needs a README with some explanation (from the slides.)
Inspector Gadget v2-2/28/94 by Bob Ebert & Ando Moon for Newton ToolKit
category: NewtonScript
keywords: Compile, NewtonScript, Hack, Evaluate
description: demonstrates using the “Compile” function to write newtonscript from the newton itself. Code on the plane...
Buttons v4-7/11/94 by Maurice Sharp & Kent Sandvik for Newton ToolKit
description: This shows how to do a keyboard, including using a picture for a keycap and using strings for what the key prints out. The new version shows one of the keys which will 'modify' the visual and output components of another key.
Number Expando v1-10/7/93 by Maurice Sharp for Newton ToolKit
category: Protos
keywords: proto, protoExpandShell, expando
description: shows how to create an expando item that takes and displays numbers. Provides a proto for people to use. Uses the setup2() messages.
Phone Expando v1-9/15/93 by Maurice Sharp for Newton ToolKit
category: Protos
keywords: protoExpandoShell, proto
description: Demonstrates a text expando with phone list style drop downs etc. Similar to phone input lines from the cardfile.
Pict Buttons v2-2/28/94 by Maurice Sharp for Newton ToolKit
category: Protos
keywords: icon, PICT resource, Masks, pictures
description: illustrates:
1. How you can change the icon of a picture button
2. Two ways to get Newton pictures from PICT resources
3. The use of picture Masks
PictIndex v1-9/15/93 by Maurice Sharp for Newton ToolKit
category: Protos
keywords: proto, protoPictIndexer, pictures
description: Demonstrates using protoPictIndexer, which allows you to specify a large picture as a series of selectable small pictures.
protoa2z_TDS v3-2/28/94 by Maurice Sharp for Newton ToolKit
category: Protos
keywords: proto, protoPictIndexer
description: protoa2z_TDS gives you the functionality of the A to Z index in the overview of the Cardfile. It's auser proto based on a proto in the ROMs.
protoTable v2-2/28/94 by Maurice Sharp & Bob Ebert for Newton ToolKit
category: Protos
keywords: protoTable, proto, lists, scroll
description: demonstrates the protoTable. Does scrolling and on the fly updating based on the selected example.
QWERTY v1-7/11/94 by J. Christopher Bell and Maurice Sharp for Newton ToolKit
description: The QWERTY project shows how to implement an on-screen keyboard which does not prompt for "add-to-dictionary?" or have the "dictionary" icon. This sample project creates a keyboard which looks like the American QWERTY keyboard.
Radio Cluster v2-2/28/94 by Kent Sandvik for Newton ToolKit
category: Protos
keywords: protoradiobutton, protoRadioCluster
description: demonstrates a radio button cluster.
• Shows how radio clusters and radiobuttons work
• Shows how to extract info from the radio cluster
• Shows some fun with view transition effects
Rec Toggle v2-2/28/94 by Maurice Sharp for Newton ToolKit
category: Protos
keywords: proto, recognition
description: Demos the recognition toggle button (as used in the notepad...).
Shell Game v3-4/22/94 by Maurice Sharp for Newton ToolKit
category: Protos
keywords: protoExpandoShell, proto
description: this little thing shows how to keep 2 shells that are side by side in sync. Kind of stupid, but you never know :-)
Show Me to the Bar v2-2/28/94 by Todd Courtois for Newton ToolKit
category: Protos
keywords: protoShowBar, filing
description: Very very simple app which shows the basics of setting up the protoShowBar. Doesn't actually do any filing, but shows you how to set up the interface. Implements the basics of all the required slots/functions for the protoShowBar.
tables and lists v2-2/28/94 by Todd Courtois for Newton ToolKit
category: Protos
keywords: protoTable, protoTextList, protos
description: Small demo of protoTable and protoTextList. Shows how you can do toggle selections on items (i.e., click once to select, then again to deselect), shows how you can do your own stuff when clicks happen (trivial in protoTextList, skanky in protoTable).
Text List v2-9/15/93 by Kent Sandvik for Newton ToolKit
category: Protos
keywords: protoTextList
description: shows how protoTextList operates
Unholy Drawers v2-2/28/94 by Todd Courtois for Newton ToolKit
category: Protos
keywords: protoDrawer, Toggle
description: This bit of sample code demonstrates how to create your own "drawers" like the Extras drawer, using the undocumented proto protoDrawer. Demonstrates how to open, close, and add child views to a protoDrawer
description: This sample demonstrates three ways to perform letter-by-letter recognition.
WordArray v1-7/11/94 by J. Christopher Bell for Newton ToolKit
category: Recognition
keywords: word array, GetWordArray, GetScoreArray
description: This project shows how to access the recognition engine's statistics regarding most-likely words and confidence scores. The GetWordArray and GetScoreArray functions do most of the work in this sample code project.
AutoRoute v1-7/11/94 by J. Christopher Bell for Newton ToolKit
description: This sample shows how to do routing without using a protoActionButton, as well as use the printerChooser proto. This sample uses the new platforms file functions Send, GetUserConfig, SetUserConfig, FlushUserConfig, and GetPrinterName.
AuxForm v3-2/28/94 by Maurice Sharp for Newton ToolKit
category: Routing
keywords: Printing, Auxiliary Form
description: Shows how to add an auxilliary information slip to print/fax slips. Also documents the process of adding these slips and the available system aux slips.
SendCard v2-12/22/93 by Maurice Sharp for Newton ToolKit
category: Routing
keywords: routing, beaming
description: Shows how to put multiple things into the outbox. Can be used as the basis of something that breaks up beams into multiple chunks
The Little Prints v4-2/28/94 by Maurice Sharp for Newton ToolKit
category: Routing
keywords: routing, print, fax
description: This is a minimalist approach to printing and faxing. That is really all it does.
v3 fixes a wee problem in the removeScript so it removes the correct thing :-)
Bitchin' Piano v2-11/12/93 by Todd Courtois for
category: Sound
keywords: sound, samplingRate
description: This sample takes two downloaded sample sounds to create a two-octave "keyboard". Eventually I'd add a nice piano-keyboard bitmap and maybe add a couple more octaves to make a more useful/pleasing piano. But for now it's a good demo of how to shift pitch on a sound by modifying the samplingRate slot in a sound frame.
Heavy Metal Disco v3-2/28/94 by Todd Courtois for Newton ToolKit
description: Shows how to use pitch shifting on the fly with a sampled sound to get some eerie and almost frightening sounds out of a single downloaded sound resource. Since v1, more efficient cloning, prettier base view, and 22KHz sound.
Simple Dialer v1-3/7/94 by Todd Courtois for Newton ToolKit
category: Sound
keywords: Dial() method, protokeyboard layout
description: This simple app mainly demonstrates the root's :Dial() method, and secondarily
demonstrates how to set up a protokeyboard.
Sound Advice v2-9/15/93 by Maurice Sharp for Newton ToolKit
category: Sound
keywords: sound, resources
description: Shows how to import sounds into NTK and play the sound from NewtonScript.
Sound Tricks v3-3/7/94 by Todd Courtois for Newton ToolKit
description: SoundTricks is intended to demonstrate a couple tricks with sound on the Newton, modifying the samplingRate of a sound sample to shift speed and pitch, and using StuffByte and ExtractByte on the actual sound samples to reverse a sound.
Notarize v2-2/28/94 by Maurice Sharp for Newton ToolKit
category: System Data
keywords: Notepad, sytem data
description: this sample shows how to transfer data from your app to the notepad while maintaining relative position of the text (and not breaking the Notepad.)
Preefer Madness v4-7/11/94 by Mike Engber & Maurice Sharp for Newton ToolKit
category: System Data
keywords: preferences, formulas, system soup
description: Demonstrates how to add your own panels (views) to the system preferences and formula roll. Also demonstrates how to properly store/retrieve your data in the system soup. Updated for info button in status bar.
Clock v2-2/28/94 by Maurice Sharp for Newton ToolKit
category: System Messages
keywords: idle, viewIdleScript, time, date
description: Demonstrates idle script and some time functions.
FalseAlarm v2-7/11/94 by Mike Engber for Newton ToolKit
category: System Services
keywords: Alarms, RegisterAlarm, Sleep
description: Demonstrates how to set alarms. Also includes a utility program for helping test your alarm application for robustness wrt installing the alarm package.
Undo Redo v2-9/15/93 by Bob Ebert for Newton ToolKit
category: System Services
keywords: Undo, Redo, ClearUndoStack
description: demonstrates registering Undo, and an attempt at Redo. See the README doc for important information on Redo.
AdjustoButton v1-7/11/94 by Maurice Sharp for Newton ToolKit
category: User Interface
keywords: button, user interface, UI
description: This sample provides user prototypes for buttons that will automatically adjust themselves to obey the user interface guidelines on button spacing. 2 protos are provided, one for a standalone button (protoAdjustoButton) and one for clusters of buttons (protoAdjustoClusterButton). The buttons also readjust when their text values are set using SetValue.
InfoButton v1-7/11/94 by Maurice Sharp for Newton ToolKit
description: This sample provides a user proto for the info button for applications (protoInfoButton). This should be used for About, Help and Prefs in an application.
Splash v1-7/11/94 by Bob Ebert & Maurice Sharp for Newton ToolKit
category: User Interface
keywords: splash screen, info button, About
description: Shows how to do a splash screen that is visible while the application is opening and an about slip using new Info button.
Chooser v2-2/28/94 by Todd Courtois for Newton ToolKit
description: Shows how to set up a simple Chooser to look for things on the net. This sample shows how to go looking for printers, but this could be extended to, say, look for macs too.
London Calling v2-2/28/94 by Maurice Sharp for Newton ToolKit
category: Utility Functions
keywords: phone, callOptionsSlip
description: Shows how to convert a phone number into one with all the area codes and other special number for dialing based on TimeZone setting. Also shows how to access the callOptionsSlip so the user can specify options like area code, dialing prefix, ...
NewTextFuncs v1-7/11/94 by Maurice Sharp for Newton ToolKit
description: Shows the TextBox and TextBounds functions.
TextBox wraps text to a box and blasts the bits to the screen
TextBounds returns the rectangle required for some text
Wally Math v2-2/28/94 by ZZ and Todd for Newton ToolKit
category: Utility Functions
keywords: Compile, Try, OnException
description: This code uses the Compile function to take written mathematical input and run it as newtonscript, then return an answer. Now has good exception handling so that things like divide by zero don't cause it to crash.
ButtnBar v2-2/28/94 by Maurice Sharp for Newton ToolKit
category: Views
keywords: statusBar, button, protoApp
description: How to add buttons to a status bar the correct way. Includes documentation and a small sample.
DatePick v1-9/15/93 by Bob Ebert for Newton ToolKit
category: Views
keywords: Month, clMonthView, local scrolling, user proto, date, day
description: Shows a user proto that implements a clMonthView based date picker like the one found in the preferences or calendar app. Lots of good stuff about clMonthView in here.
Modal Fun v2-2/28/94 by Maurice Sharp for Newton ToolKit
category: Views
keywords: modal dialog
description: shows how to do an application modal dialog, though why anyone would want to...
NoSelect v1-7/11/94 by J. Christopher Bell for Newton ToolKit
description: This example shows how to use the new platforms file function called ClearSelectionHilites. The function unselects selected data in a view, including the EditView special "grey border" selection.
Paragraph Scroll v2-11/12/93 by Todd Courtois for Newton ToolKit
category: Views
keywords: scrolling, size, viewOrigin
description: ParagraphScroll shows one way to scroll a clParagraphView. Creates the view, stuffs it full of text, then changes the viewOrigin of the parent repeatedly.
Scroll Over v2-10/13/93 by Bob Ebert for Newton ToolKit
category: Views
keywords: Scrolling, Horizontal, Vertical, World Map, PICTs, tap and drag, SetOrigin
description: demonstrates 2D scrolling of larger views within a clipping view via two methods, totally custom and using abuilt in proto. v2 removes an extra call to :Dirty() that wasn't necessary.
Size Doesn't Matter v2-9/15/93 by Bob Ebert for Newton ToolKit
description: Demonstrates dragging to change the size of a view, with intermediate feedback. Also demonstrates how to repair viewBounds after Drag() has munged them.
Strange Changes v2-3/8/94 by Todd Courtois for Newton ToolKit
description: This sample code implements a workaround to a current clEditView bug. The bug is, if you change the clPolygonView child of a clEditView without changing the viewBounds of the polygonView, the clEditView's viewChangedScript will not be called as it should be.
This is a good example for studying when certain scripts are called in a clEditView. It prints to the listener as various scripts are called. Also very instructive on how to add your own scripts to the auto-generated children of a clEditView.
SyncScroll v1-7/11/94 by J. Christopher Bell for Newton ToolKit
category: Views
keywords: SyncScroll scroll view height templates
description: This example shows how to use SyncScroll and how to use the 'height' slot correctly with view templates.
TabsNStyles v2-9/15/93 by Kent Sandvik and Christopher Bell for Newton ToolKit
category: Views
keywords: clParagraphView styles tabs
description: demonstrates:
• style information in a clParagraphView
• tab information in a clParagraphView
ViewScripts v2-2/28/94 by Bob Ebert & Gabriel Acosta-Lopez for Newton ToolKit
description: illustrates order of form, child, done, and drawing scripts.
WakeUpAndGoToSleep v1-3/3/94 by Mike Engber for Newton ToolKit
category: Views
keywords: PowerOffScript, Sleep
description: Shows how to detect when the Newton wakes up.
Wrap It Up v3-7/11/94 by Bob Ebert & J. Christopher Bell for Newton ToolKit
category: Views
keywords: clParagraphView, clEditView, wrapping, line height, vCalculateBounds, SimpleTextHeight
description: illustrates dynamically changing the height of clParagraphViews based on their contents. Two ways to do it are illustrated, one using the vCalculateBounds viewFlag, and one using a platform file function to calculate paragraph heights.
Checkbook v3-3/9/94 by Neil Rhodes & PIE DTS for Newton ToolKit
It supports routing, filing, IA and Newton Connection. See the README for more info.
Extra Change v2-10/27/93 by Mike Engber for Newton ToolKit
category: Miscellaneous (Other)
keywords: SetExtrasInfo,Extras Drawer,Icon
description: This sample app changes it's icon(and text) in the Extras drawer when you tap it.
SoupShow v2-12/22/93
by Maurice Sharp for Newton ToolKit
category: Miscellaneous (Other)
keywords: views, application design, display data, data
description: This multi-part sample shows how to display data without all the noise of creating soups. It displays the names from the names file. It has 2 parts, a simple implementation that just has an individual item view and scrolls through names. It also has a more complex sample that does an overview as well.
Sample Code List - sorted by Name
Updated 4:04 PM 7/11/94
NOTE: Sample code is maintained and blessed by Bob Ebert. Please mail ebert@newton.apple.com orALink: EBERT if you would like to comment, request, submit, or otherwise chat about sample code.
DTS does not necessarily guarantee lack of bugs and/or suitability of samples for home use. The sample code provided by DTS should run and have some reasonable level of documentation, and will generally illustrate an important point about Newton programming, but should not be viewed as the correct or ideal approach for all occasions. Design issues vary from application to application, and (good as they are) the DTS engineers occasionally make mistakes.
Sample code is on ftp.apple.com in pie/newton/samples.
Sample code is on the Apple engineering net in EtherKnott:ES•Newton Software
Sample code is on AppleLink, spread around the appropriate sub-folders, in:
AdjustoButton v1-7/11/94 by Maurice Sharp for Newton ToolKit
category: User Interface
keywords: button, user interface, UI
description: This sample provides user prototypes for buttons that will automatically adjust themselves to obey the user interface guidelines on button spacing. 2 protos are provided, one for a standalone button (protoAdjustoButton) and one for clusters of buttons (protoAdjustoClusterButton). The buttons also readjust when their text values are set using SetValue.
ADSP Sample v2-7/11/94 by Mike Cremer, Randy Carr, Kent Sandvik, Jim Schram for Newton ToolKit
description: This sample app is based on the terminal emulator first introduced in andCrank and BitSpew. It has been modified to support the modem tool, including Apple and some Rockwell modems. It sets up a modem endpoint using the sampleModemEndpoint, mySerialIOPrefs, and myServicePrefs, then Instantiates in the connectButton's viewClickScript and Connects as a deferred action in ConnectMe.
AutoRoute v1-7/11/94 by J. Christopher Bell for Newton ToolKit
description: This sample shows how to do routing without using a protoActionButton, as well as use the printerChooser proto. This sample uses the new platforms file functions Send, GetUserConfig, SetUserConfig, FlushUserConfig, and GetPrinterName.
AuxForm v3-2/28/94 by Maurice Sharp for Newton ToolKit
category: Routing
keywords: Printing, Auxiliary Form
description: Shows how to add an auxilliary information slip to print/fax slips. Also documents the process of adding these slips and the available system aux slips.
Beyond Help v3-7/11/94 by Bob Ebert & Maurice Sharp for Newton Book Maker
category: Digital books
keywords: Help Book, Dickens, Tiny Tim, How Do I
description: Illustrates creation and usege of a custom help book.
Bitchin' Piano v2-11/12/93 by Todd Courtois for
category: Sound
keywords: sound, samplingRate
description: This sample takes two downloaded sample sounds to create a two-octave "keyboard". Eventually I'd add a nice piano-keyboard bitmap and maybe add a couple more octaves to make a more useful/pleasing piano. But for now it's a good demo of how to shift pitch on a sound by modifying the samplingRate slot in a sound frame.
BookSample v2-11/12/93 by Bob Ebert for Newton Book Maker
category: Digital books
keywords: Digital Books, Dickens, Copperfield, Book Maker, Book Reader, Users Guide
description: A sample book source--the Newton Book Maker User's Manual in Newton Book Reader form.
Built-In MetaDatas v1-12/15/93 by Peter Alley for Text
category: Connection Kit
keywords: MetaData, Newton Connection, Built In Apps
description: These are the updated MetaDatas for the built in Names and Card File applications for Newton Connection 2.0. They illustrate the validation and multiple-export script features of Connection 2.0. (They won't be found in the Newton, since they're encapsulated inside Newton Connection.)
ButtnBar v2-2/28/94 by Maurice Sharp for Newton ToolKit
category: Views
keywords: statusBar, button, protoApp
description: How to add buttons to a status bar the correct way. Includes documentation and a small sample.
Buttons v4-7/11/94 by Maurice Sharp & Kent Sandvik for Newton ToolKit
description: Shows how to set up a simple Chooser to look for things on the net. This sample shows how to go looking for printers, but this could be extended to, say, look for macs too.
Clock v2-2/28/94 by Maurice Sharp for Newton ToolKit
category: System Messages
keywords: idle, viewIdleScript, time, date
description: Demonstrates idle script and some time functions.
Date Expando v1-9/15/93 by Maurice Sharp for Newton ToolKit
category: Protos
keywords: protoExpando, proto
description: demonstrates a text expando with date fields.
DatePick v1-9/15/93 by Bob Ebert for Newton ToolKit
category: Views
keywords: Month, clMonthView, local scrolling, user proto, date, day
description: Shows a user proto that implements a clMonthView based date picker like the one found in the preferences or calendar app. Lots of good stuff about clMonthView in here.
Different Strokes v2-9/15/93 by Bob Ebert for Newton ToolKit
category: Drawing
keywords: Drawing, viewClickScript, ink
description: demonstrates how to capture ink and turn it into drawing objects for rendering on the screen, saving, etc.
Dot2Dot v2-9/15/93 by Kent Sandvik for Newton ToolKit
category: Drawing
keywords: view points polygon
description: Demonstrates the following:
• mapping global coordinates to local ones
• tracking pen clicks and convert them to an array suitable for a polygon
• view system handling
• creating arrays in RAM
• dynamically changing a clPictureView's icon slot
Drawing v2-2/28/94 by Bob Ebert for Newton ToolKit
category: Drawing
keywords: drawing, polygon, line, point, rectangle, style, font, pict, shape
description: Demonstrates functions in drawing chapter, shows how to make shapes and display them, as well as how to offset the shapes.
DynaPicker v1-11/12/93 by Todd Courtois for Newton ToolKit
category: Protos
keywords: protoLabelPicker
description: Shows how to dynamically change the items in a protoLabelPicker.
Expando Time v2-3/7/94 by Giovanna Ostacchini & Maurice Sharp for Newton ToolKit
category: Protos
keywords: Time, date, protoExpando, expando shell
description: A custom expando item that edits a time. Shows how to create a custom expando item based on protoTextExpando
Extra Change v2-10/27/93 by Mike Engber for Newton ToolKit
category: Miscellaneous (Other)
keywords: SetExtrasInfo,Extras Drawer,Icon
description: This sample app changes it's icon(and text) in the Extras drawer when you tap it.
FalseAlarm v2-7/11/94 by Mike Engber for Newton ToolKit
category: System Services
keywords: Alarms, RegisterAlarm, Sleep
description: Demonstrates how to set alarms. Also includes a utility program for helping test your alarm application for robustness wrt installing the alarm package.
Font Scaling v3-9/15/93 by Bob Ebert for Newton ToolKit
category: Drawing
keywords: drawing, font, scaling, pict, word, dictionary
description: Demonstrates how to scale fonts. Not as simple as you might think at first... you have to put a text shape into a PICT shape and scale that. There are some clipping concerns as well.
Gauges v2-2/28/94 by Kent Sandvik for Newton ToolKit
category: Protos
keywords: protoGauge max min protoLabelinputline
description: the Gauges sample shows the following techniques:
• How to use a protoGauge
• How to change the max (or min) values of a gauge dynamically
• How to tie together this with smart use of a protoLabelInputLine
GetPoly v1-7/11/94 by J. Christopher Bell for Newton ToolKit
category: Drawing
keywords: clPolygonView
description: This example shows how you can acquire a "points" structure for use with a clPolygonView. The GetPoly sample uses two techniques, one using shape recognition and another using all points in a pen stroke.
Glancing v2-2/28/94 by Kent Sandvik for Newton ToolKit
description: This application is the basic template for creation of data logging applications. It will store and retrieve records from a soup, also beam, find, use Newton Connection kit and file the entries.
Greasy Spoon v2-2/28/94 by Giovanna Ostacchini for Newton ToolKit
category: Protos
keywords: protoPicker, pop up menus, order
description: A fairly straightforward demonstration of the protoPicker.
description: Shows how one can do fast text drawing by hand. Simple blasts an array of text lines to a clView. Does no wrapping, but scrolls.
Calls to GetRandomWord() could be replaced by useful text-formatting routines to take your gobs of text and get it onscreen quickly. Important for things like terminal emulators.
Heavy Metal Disco v3-2/28/94 by Todd Courtois for Newton ToolKit
description: Shows how to use pitch shifting on the fly with a sampled sound to get some eerie and almost frightening sounds out of a single downloaded sound resource. Since v1, more efficient cloning, prettier base view, and 22KHz sound.
IA Tour v3-2/28/94 by Bill Luciw for Inspector/Listner
description: This is code used during the Newton Developer Conference-93, Intelligent Assist presentation. Version 2 fixes a couple of bugs that prevented straight through allocation. It needs a README with some explanation (from the slides.)
IdleScript Anime v2-2/28/94 by Todd Courtois for Newton ToolKit
category: Drawing
keywords: IdleScript drawing, animation, PlaySound and drawing speed effects, protoIconButton
description: This app contains four similar clViews which execute simple animation in their idleScripts.
InfoButton v1-7/11/94 by Maurice Sharp for Newton ToolKit
description: This sample provides a user proto for the info button for applications (protoInfoButton). This should be used for About, Help and Prefs in an application.
Inspector Gadget v2-2/28/94 by Bob Ebert & Ando Moon for Newton ToolKit
category: NewtonScript
keywords: Compile, NewtonScript, Hack, Evaluate
description: demonstrates using the “Compile” function to write newtonscript from the newton itself. Code on the plane...
IR Remote Sample v2-7/11/94 by Mike Cremer & Kent Sandvik for Newton ToolKit
category: Communications
keywords: Communications endpoint IR remote control
description: This sample shows how to make use of the specific IR functions for controlling consumer electronics applications. See the Q&A Communication sample for technical details. Note that the RC5.r file has resources for controlling Philips devices, and the Sony.r file has resource definitions for Sony consumer electronics products. You need to contact various other consumer electronics companies for more infomation about their IR protocols.
IRSample v1-12/22/93 by Mike Cremer & Randy Carr & Kent Sandvik for Newton ToolKit
category: Communications
keywords: Communication, IR, InfraRed, endpoint
description: This sample shows how to make use of the IR endpoints, also how to write IR protocol applications.
IRTimeSync v2-7/11/94 by Jim Schram for Newton ToolKit
category: Communications
keywords: IR Beam Time Synchronization State Machine Timeout
description: Synchronize the date-time clocks of two Newtons via IR beaming. Demonstrates:
1. Clock synchronization to +/- one second.
2. Using SharpIR beaming protocol with strings.
3. Simple state machine.
4. Asynchronous Connect().
5. Handling time-outs.
6. Synchronous SysBeep().
Keys v3-2/28/94 by Maurice Sharp, J. Christopher Bell for Newton ToolKit
description: This shows how to do a keyboard, including using a picture for a keycap and using strings for what the key prints out. The new version shows one of the keys which will 'modify' the visual and output components of another key.
description: This sample demonstrates three ways to perform letter-by-letter recognition.
LlamaTalk v1-7/11/94 by Jim Schram for Newton ToolKit
category: Communications
keywords: LlamaTalk LlamaShare AppleTalk ADSP MNP Echo Server State Machine
description: Everything you ever wanted to know about making ADSP work in Newton OS 1.3 and earlier (don't taunt the ADSP endpoint...) This is a HUGE two-part sample comprised of both Newton & Mac code. The Newton component is a simple front-end which demonstrates sending and receiving transactions of various data types. It makes calls to a protoLlamaTalk user proto which is an encapsulation of EVERYTHING needed to handle ADSP and MNP communications reliably. The Mac component is a simple back-end which receives transactions and echos back a "hex dump" of the transaction data. It makes calls to a robust multiple-client communications library built on top of the Mac CommToolBox. ALL I/O is asynchronous and interrupt-driven. The library uses no globals and can be called from within an Application, Control Panel, Init, XCommand, 4D External, etc. etc.
London Calling v2-2/28/94 by Maurice Sharp for Newton ToolKit
category: Utility Functions
keywords: phone, callOptionsSlip
description: Shows how to convert a phone number into one with all the area codes and other special number for dialing based on TimeZone setting. Also shows how to access the callOptionsSlip so the user can specify options like area code, dialing prefix, ...
Modal Fun v2-2/28/94 by Maurice Sharp for Newton ToolKit
category: Views
keywords: modal dialog
description: shows how to do an application modal dialog, though why anyone would want to...
MonacoTest v2-3/11/94 by Kent Sandvik & Mike Engber for
category: Drawing
keywords: Fonts
description: This sample provides a mono-spaced font for use on the Newton (Monaco 9) and gives a short demonstration of how to use it.
NewTextFuncs v1-7/11/94 by Maurice Sharp for Newton ToolKit
description: This example shows how to use the new platforms file function called ClearSelectionHilites. The function unselects selected data in a view, including the EditView special "grey border" selection.
Notarize v2-2/28/94 by Maurice Sharp for Newton ToolKit
category: System Data
keywords: Notepad, sytem data
description: this sample shows how to transfer data from your app to the notepad while maintaining relative position of the text (and not breaking the Notepad.)
Number Expando v1-10/7/93 by Maurice Sharp for Newton ToolKit
category: Protos
keywords: proto, protoExpandShell, expando
description: shows how to create an expando item that takes and displays numbers. Provides a proto for people to use. Uses the setup2() messages.
Paragraph Scroll v2-11/12/93 by Todd Courtois for Newton ToolKit
category: Views
keywords: scrolling, size, viewOrigin
description: ParagraphScroll shows one way to scroll a clParagraphView. Creates the view, stuffs it full of text, then changes the viewOrigin of the parent repeatedly.
Phone Expando v1-9/15/93 by Maurice Sharp for Newton ToolKit
category: Protos
keywords: protoExpandoShell, proto
description: Demonstrates a text expando with phone list style drop downs etc. Similar to phone input lines from the cardfile.
Pict Buttons v2-2/28/94 by Maurice Sharp for Newton ToolKit
category: Protos
keywords: icon, PICT resource, Masks, pictures
description: illustrates:
1. How you can change the icon of a picture button
2. Two ways to get Newton pictures from PICT resources
3. The use of picture Masks
PictIndex v1-9/15/93 by Maurice Sharp for Newton ToolKit
category: Protos
keywords: proto, protoPictIndexer, pictures
description: Demonstrates using protoPictIndexer, which allows you to specify a large picture as a series of selectable small pictures.
Preefer Madness v4-7/11/94 by Mike Engber & Maurice Sharp for Newton ToolKit
category: System Data
keywords: preferences, formulas, system soup
description: Demonstrates how to add your own panels (views) to the system preferences and formula roll. Also demonstrates how to properly store/retrieve your data in the system soup. Updated for info button in status bar.
protoa2z_TDS v3-2/28/94 by Maurice Sharp for Newton ToolKit
category: Protos
keywords: proto, protoPictIndexer
description: protoa2z_TDS gives you the functionality of the A to Z index in the overview of the Cardfile. It's auser proto based on a proto in the ROMs.
protoTable v2-2/28/94 by Maurice Sharp & Bob Ebert for Newton ToolKit
category: Protos
keywords: protoTable, proto, lists, scroll
description: demonstrates the protoTable. Does scrolling and on the fly updating based on the selected example.
pseudoInspector v2-3/1/94 by Todd Courtois for Newton ToolKit
category: Communications
keywords: serial, comms, "inspector"
description: This sample takes the SerialProtocol sample of Kent Sandvik one step further by implementing a very primitive Inspector. Strings that are sent to the newton (using the same method as in SerialPro) are processed kinda like in the Inspector or Inspector Gadget.
Version 2 cleans out Print statements and resizes properly.
QWERTY v1-7/11/94 by J. Christopher Bell and Maurice Sharp for Newton ToolKit
description: The QWERTY project shows how to implement an on-screen keyboard which does not prompt for "add-to-dictionary?" or have the "dictionary" icon. This sample project creates a keyboard which looks like the American QWERTY keyboard.
Radio Cluster v2-2/28/94 by Kent Sandvik for Newton ToolKit
category: Protos
keywords: protoradiobutton, protoRadioCluster
description: demonstrates a radio button cluster.
• Shows how radio clusters and radiobuttons work
• Shows how to extract info from the radio cluster
• Shows some fun with view transition effects
Rec Toggle v2-2/28/94 by Maurice Sharp for Newton ToolKit
category: Protos
keywords: proto, recognition
description: Demos the recognition toggle button (as used in the notepad...).
Scroll Over v2-10/13/93 by Bob Ebert for Newton ToolKit
category: Views
keywords: Scrolling, Horizontal, Vertical, World Map, PICTs, tap and drag, SetOrigin
description: demonstrates 2D scrolling of larger views within a clipping view via two methods, totally custom and using abuilt in proto. v2 removes an extra call to :Dirty() that wasn't necessary.
SendCard v2-12/22/93 by Maurice Sharp for Newton ToolKit
category: Routing
keywords: routing, beaming
description: Shows how to put multiple things into the outbox. Can be used as the basis of something that breaks up beams into multiple chunks
Shell Game v3-4/22/94 by Maurice Sharp for Newton ToolKit
category: Protos
keywords: protoExpandoShell, proto
description: this little thing shows how to keep 2 shells that are side by side in sync. Kind of stupid, but you never know :-)
Show Me to the Bar v2-2/28/94 by Todd Courtois for Newton ToolKit
category: Protos
keywords: protoShowBar, filing
description: Very very simple app which shows the basics of setting up the protoShowBar. Doesn't actually do any filing, but shows you how to set up the interface. Implements the basics of all the required slots/functions for the protoShowBar.
Simple Dialer v1-3/7/94 by Todd Courtois for Newton ToolKit
category: Sound
keywords: Dial() method, protokeyboard layout
description: This simple app mainly demonstrates the root's :Dial() method, and secondarily
demonstrates how to set up a protokeyboard.
Size Doesn't Matter v2-9/15/93 by Bob Ebert for Newton ToolKit
description: Demonstrates dragging to change the size of a view, with intermediate feedback. Also demonstrates how to repair viewBounds after Drag() has munged them.
Sound Advice v2-9/15/93 by Maurice Sharp for Newton ToolKit
category: Sound
keywords: sound, resources
description: Shows how to import sounds into NTK and play the sound from NewtonScript.
Sound Tricks v3-3/7/94 by Todd Courtois for Newton ToolKit
description: SoundTricks is intended to demonstrate a couple tricks with sound on the Newton, modifying the samplingRate of a sound sample to shift speed and pitch, and using StuffByte and ExtractByte on the actual sound samples to reverse a sound.
Soup Hacking v1-9/15/93 by Kent Sandvik for Inspector/Listner
description: Inspector-compatible text file illustrating some useful Soup functions.
Soup Tour v2-3/7/93 by David Levy & Kent Sandvik for Inspector/Listner
category: Data Storage (Soups)
keywords: Soup index entries stores Query Cursor
description: This is a simple walkthrough of many store and soup functions, including queries and smart index tricks. Check this out using an Inspector Window.
SoupShow v2-12/22/93 by Maurice Sharp for Newton ToolKit
category: Miscellaneous (Other)
keywords: views, application design, display data, data
description: This multi-part sample shows how to display data without all the noise of creating soups. It displays the names from the names file. It has 2 parts, a simple implementation that just has an individual item view and scrolls through names. It also has a more complex sample that does an overview as well.
Full step by step readmees make this a happy happy joy joy experience
Splash v1-7/11/94 by Bob Ebert & Maurice Sharp for Newton ToolKit
category: User Interface
keywords: splash screen, info button, About
description: Shows how to do a splash screen that is visible while the application is opening and an about slip using new Info button.
Strange Changes v2-3/8/94 by Todd Courtois for Newton ToolKit
description: This sample code implements a workaround to a current clEditView bug. The bug is, if you change the clPolygonView child of a clEditView without changing the viewBounds of the polygonView, the clEditView's viewChangedScript will not be called as it should be.
This is a good example for studying when certain scripts are called in a clEditView. It prints to the listener as various scripts are called. Also very instructive on how to add your own scripts to the auto-generated children of a clEditView.
SuperSlurp v1-7/11/94 by Jim Schram, Todd Courtois, ZZ, Kent Sandvik for Newton ToolKit
category: Communications
keywords: soup, serial MNP endpoint, connection to PC or Mac
description: SuperSlurp sucks soup data down from a Mac via a serial endpoint, then stuffs it into a soup. SuperSlurp has the capability of creating soups which are currently non-resident on the Newton at runtime, by command of the Mac.
SuperSlurp uses SERIAL MNP at 57600 bps. Must have the Apple Modem CTB Tool which comes with NTK to use it. Stuffs entries into the soup much much faster than old Slurp, also transfers data much faster and more reliably with MNP.
Sync Another One v2-3/8/94 by Bob Ebert for Newton ToolKit
category: Connection Kit
keywords: Newton Connection, Macintosh, PC, Windows, MetaData, Soup, Store, User Interface
description: Illustrates how to write (and TEST) Newton Connection MetaData.
SyncScroll v1-7/11/94 by J. Christopher Bell for Newton ToolKit
category: Views
keywords: SyncScroll scroll view height templates
description: This example shows how to use SyncScroll and how to use the 'height' slot correctly with view templates.
tables and lists v2-2/28/94 by Todd Courtois for Newton ToolKit
category: Protos
keywords: protoTable, protoTextList, protos
description: Small demo of protoTable and protoTextList. Shows how you can do toggle selections on items (i.e., click once to select, then again to deselect), shows how you can do your own stuff when clicks happen (trivial in protoTextList, skanky in protoTable).
TabsNStyles v2-9/15/93 by Kent Sandvik and Christopher Bell for Newton ToolKit
category: Views
keywords: clParagraphView styles tabs
description: demonstrates:
• style information in a clParagraphView
• tab information in a clParagraphView
Text List v2-9/15/93 by Kent Sandvik for Newton ToolKit
category: Protos
keywords: protoTextList
description: shows how protoTextList operates
The Little Prints v4-2/28/94 by Maurice Sharp for Newton ToolKit
category: Routing
keywords: routing, print, fax
description: This is a minimalist approach to printing and faxing. That is really all it does.
v3 fixes a wee problem in the removeScript so it removes the correct thing :-)
True Grid v1-7/11/94 by Bob Ebert for Newton ToolKit
category: Application Design
keywords: Grid View, Drawing, columns, proto, performance
description: Implements three different ways to do scrolling "grid" views based on soup data, and evaluates the complexity and performance tradeoffs of each.
Undo Redo v2-9/15/93 by Bob Ebert for Newton ToolKit
category: System Services
keywords: Undo, Redo, ClearUndoStack
description: demonstrates registering Undo, and an attempt at Redo. See the README doc for important information on Redo.
Unholy Drawers v2-2/28/94 by Todd Courtois for Newton ToolKit
category: Protos
keywords: protoDrawer, Toggle
description: This bit of sample code demonstrates how to create your own "drawers" like the Extras drawer, using the undocumented proto protoDrawer. Demonstrates how to open, close, and add child views to a protoDrawer
Up In Smoke v3-10/1/93 by Mike Engber for Newton ToolKit
category: Drawing
keywords: Smoke, Clouds, Poof, Drawing, CopyBits
description: Shows how to achieve the ever popular smoke/poof/scrub effect. Also illustrates scaling with CopyBits, using modeMask with CopyBits, and using BuildContext to force an update of an area of the screen.
ViewScripts v2-2/28/94 by Bob Ebert & Gabriel Acosta-Lopez for Newton ToolKit
description: illustrates order of form, child, done, and drawing scripts.
WakeUpAndGoToSleep v1-3/3/94 by Mike Engber for Newton ToolKit
category: Views
keywords: PowerOffScript, Sleep
description: Shows how to detect when the Newton wakes up.
Wally Math v2-2/28/94 by ZZ and Todd for Newton ToolKit
category: Utility Functions
keywords: Compile, Try, OnException
description: This code uses the Compile function to take written mathematical input and run it as newtonscript, then return an answer. Now has good exception handling so that things like divide by zero don't cause it to crash.
WordArray v1-7/11/94 by J. Christopher Bell for Newton ToolKit
category: Recognition
keywords: word array, GetWordArray, GetScoreArray
description: This project shows how to access the recognition engine's statistics regarding most-likely words and confidence scores. The GetWordArray and GetScoreArray functions do most of the work in this sample code project.
Wrap It Up v3-7/11/94
by Bob Ebert & J. Christopher Bell for Newton ToolKit
category: Views
keywords: clParagraphView, clEditView, wrapping, line height, vCalculateBounds, SimpleTextHeight
description: illustrates dynamically changing the height of clParagraphViews based on their contents. Two ways to do it are illustrated, one using the vCalculateBounds viewFlag, and one using a platform file function to calculate paragraph heights.